using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;

public class UIMgr : MonoBehaviour
{
    public Button _Start;
    public Button _Quit;
    public GameObject _start_panel;
    public GameObject _UIArray;


    public static UIMgr Instance;
    public void Awake()
    {
        Instance = this;
    }
   

 

    void Start()
    {
        _start_panel = GameObject.Find("Root_Panel");
        _UIArray = GameObject.Find("UIRoot");
        _UIArray.SetActive(false);
        _Start = GameObject.Find("StartGame").transform.GetComponent<Button>();
        _Start.onClick.AddListener(StartGame);
        _Quit=GameObject.Find("QuitGame").transform.GetComponent<Button>();
        _Quit.onClick.AddListener(QuitGame);
    }


    public void StartGame()
    {
        Main.Instance.StartNum = 1;
        _UIArray.SetActive(true);
        _start_panel.SetActive(false);
        Main.Instance._init_birthArray();
        onClickAudio();

    }

    
    public void show_ESC(bool isShow)
    {
        _start_panel.SetActive(isShow);
        
    }

    public void QuitGame()
    {
        _start_panel.SetActive(false);
        onClickAudio();
        Application.Quit();
    }
    public void onClickAudio()
    {
        AutioMgr.Instance.OnclickAudio();
    }

    
}
